import { Request, Response } from 'express';
import Mock from 'mockjs';

const catalogs = ['企业认证', '个人认证', '项目补助', '场地补助', '小规模纳税人'];

// 获取政策列表
const getPolicys = (req: Request, res: Response) => {
  res.json({
    code: 0,
    data: Mock.mock({
      total: 100,
      'items|10': [
        {
          id: '@id',
          'number|+1': 1,
          'catalog|1': catalogs,
          name: '@name',
          'view|1-100': 1,
          'type|1-3': 1,
          'status|0-1': 1,
          created: '@datetime()',
        },
      ],
    }),
  });
};

export default {
  'GET /api_v1/policys': getPolicys,
};
